<?php

namespace app\admin\validate;

use think\Validate;

class Config extends Validate {

    /**
     * 规则定义
     * @var array
     */
    protected $rule = [
        'id'         => 'number',
        'page'       => 'number',
        'pageSize'   => 'number',
        'title'      => 'require|min:2|max:10',
        'key'        => 'require|alphaDash',
        'value'      => 'require',
    ];

    /**
     * 提示信息定义
     * @var array
     */
    protected $message = [
        'id'       => 'ID类型为正整数',
        'page'     => '分页参数类型为正整数',
        'pageSize' => '每页展示参数为正整数',
        'title'    => '请输入2-10位字符名称',
        'key'      => '请输入字母下划线组成的变量名称',
        'value'    => '请输入变量值',

    ];

    /**
     * 场景定义
     * @var array
     */
    public $scene = [
        'operateAjax'      => ['key', 'value', 'title'],
    ];
}